package com.fastjrun.eladmin.itrms.mapstruct;

import com.fastjrun.eladmin.itrms.domain.DEPLOY_TYPE;
import com.fastjrun.eladmin.itrms.domain.DEPLOY_WAY;
import com.fastjrun.eladmin.itrms.dto.DeploymentDTO;
import com.fastjrun.eladmin.itrms.entity.RmsDeployment;
import com.fastjrun.eladmin.itrms.vo.DeploymentVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import java.util.List;

public  abstract class RmsDeploymentMapperDecorator implements RmsDeploymentMapper {

    @Autowired
    @Qualifier("delegate")
    private RmsDeploymentMapper delegate;
    @Override
    public DeploymentVO toVO(RmsDeployment entity) {
        DeploymentVO deploymentVO= delegate.toVO(entity);
        deploymentVO.setDeployTypeValue(DEPLOY_TYPE.getValue(entity.getDeployType()));
        deploymentVO.setDeployWayValue(DEPLOY_WAY.getValue(entity.getDeployWay()));
        return null;
    }

    @Override
    public List<DeploymentVO> toVO(List<RmsDeployment> entityList) {
        return delegate.toVO(entityList);
    }

    @Override
    public RmsDeployment toEntity(DeploymentDTO dto) {
        return delegate.toEntity(dto);
    }
}
